.class public Lcom/estrongs/android/ui/view/ShimmerView;
.super Landroid/view/View;
.source "ShimmerView.java"


# instance fields
.field private a:Landroid/graphics/Shader;

.field private b:Landroid/graphics/Matrix;

.field private c:Landroid/graphics/Paint;

.field private d:I

.field private e:I

.field private f:F

.field private g:F

.field private h:Landroid/graphics/Rect;

.field private i:Landroid/animation/ValueAnimator;

.field private j:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0

    .line 1
    invoke-direct {p0, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V

    const/4 p1, 0x0

    .line 2
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->d:I

    .line 3
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->e:I

    const/4 p1, 0x0

    .line 4
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->f:F

    .line 5
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->g:F

    .line 6
    invoke-direct {p0}, Lcom/estrongs/android/ui/view/ShimmerView;->c()V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0
    .param p2    # Landroid/util/AttributeSet;
        .annotation build Landroidx/annotation/Nullable;
        .end annotation
    .end param

    .line 7
    invoke-direct {p0, p1, p2}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    const/4 p1, 0x0

    .line 8
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->d:I

    .line 9
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->e:I

    const/4 p1, 0x0

    .line 10
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->f:F

    .line 11
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->g:F

    .line 12
    invoke-direct {p0}, Lcom/estrongs/android/ui/view/ShimmerView;->c()V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0
    .param p2    # Landroid/util/AttributeSet;
        .annotation build Landroidx/annotation/Nullable;
        .end annotation
    .end param

    .line 13
    invoke-direct {p0, p1, p2, p3}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    const/4 p1, 0x0

    .line 14
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->d:I

    .line 15
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->e:I

    const/4 p1, 0x0

    .line 16
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->f:F

    .line 17
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->g:F

    .line 18
    invoke-direct {p0}, Lcom/estrongs/android/ui/view/ShimmerView;->c()V

    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/ui/view/ShimmerView;)F
    .locals 0

    .line 1
    iget p0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->f:F

    return p0
.end method

.method static synthetic a(Lcom/estrongs/android/ui/view/ShimmerView;F)F
    .locals 0

    .line 2
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->f:F

    return p1
.end method

.method static synthetic b(Lcom/estrongs/android/ui/view/ShimmerView;F)F
    .locals 0

    .line 2
    iput p1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->g:F

    return p1
.end method

.method static synthetic b(Lcom/estrongs/android/ui/view/ShimmerView;)I
    .locals 0

    .line 1
    iget p0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->d:I

    return p0
.end method

.method static synthetic c(Lcom/estrongs/android/ui/view/ShimmerView;)F
    .locals 0

    .line 1
    iget p0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->g:F

    return p0
.end method

.method private c()V
    .locals 1

    .line 2
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->h:Landroid/graphics/Rect;

    .line 3
    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->c:Landroid/graphics/Paint;

    .line 4
    invoke-direct {p0}, Lcom/estrongs/android/ui/view/ShimmerView;->d()V

    return-void
.end method

.method static synthetic d(Lcom/estrongs/android/ui/view/ShimmerView;)I
    .locals 0

    .line 1
    iget p0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->e:I

    return p0
.end method

.method private d()V
    .locals 3

    const/4 v0, 0x2

    new-array v0, v0, [F

    .line 2
    fill-array-data v0, :array_0

    invoke-static {v0}, Landroid/animation/ValueAnimator;->ofFloat([F)Landroid/animation/ValueAnimator;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->i:Landroid/animation/ValueAnimator;

    const-wide/16 v1, 0x9c4

    .line 3
    invoke-virtual {v0, v1, v2}, Landroid/animation/ValueAnimator;->setDuration(J)Landroid/animation/ValueAnimator;

    .line 4
    iget-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->i:Landroid/animation/ValueAnimator;

    const/4 v1, -0x1

    invoke-virtual {v0, v1}, Landroid/animation/ValueAnimator;->setRepeatCount(I)V

    .line 5
    iget-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->i:Landroid/animation/ValueAnimator;

    new-instance v1, Lcom/estrongs/android/ui/view/ShimmerView$a;

    invoke-direct {v1, p0}, Lcom/estrongs/android/ui/view/ShimmerView$a;-><init>(Lcom/estrongs/android/ui/view/ShimmerView;)V

    invoke-virtual {v0, v1}, Landroid/animation/ValueAnimator;->addUpdateListener(Landroid/animation/ValueAnimator$AnimatorUpdateListener;)V

    return-void

    :array_0
    .array-data 4
        0x0
        0x3f800000    # 1.0f
    .end array-data
.end method

.method static synthetic e(Lcom/estrongs/android/ui/view/ShimmerView;)Landroid/graphics/Matrix;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->b:Landroid/graphics/Matrix;

    return-object p0
.end method

.method static synthetic f(Lcom/estrongs/android/ui/view/ShimmerView;)Landroid/graphics/Shader;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->a:Landroid/graphics/Shader;

    return-object p0
.end method


# virtual methods
.method public a()V
    .locals 2

    .line 3
    iget-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->i:Landroid/animation/ValueAnimator;

    if-nez v0, :cond_0

    .line 4
    invoke-direct {p0}, Lcom/estrongs/android/ui/view/ShimmerView;->d()V

    .line 5
    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->i:Landroid/animation/ValueAnimator;

    if-eqz v0, :cond_1

    iget-boolean v1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->j:Z

    if-nez v1, :cond_1

    const/4 v1, 0x1

    .line 6
    iput-boolean v1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->j:Z

    .line 7
    invoke-virtual {v0}, Landroid/animation/ValueAnimator;->start()V

    :cond_1
    return-void
.end method

.method public b()V
    .locals 2

    .line 3
    iget-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->i:Landroid/animation/ValueAnimator;

    if-eqz v0, :cond_0

    iget-boolean v1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->j:Z

    if-eqz v1, :cond_0

    const/4 v1, 0x0

    .line 4
    iput-boolean v1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->j:Z

    .line 5
    invoke-virtual {v0}, Landroid/animation/ValueAnimator;->cancel()V

    .line 6
    invoke-virtual {p0}, Landroid/view/View;->invalidate()V

    const/4 v0, 0x0

    .line 7
    iput-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->i:Landroid/animation/ValueAnimator;

    :cond_0
    return-void
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 2

    .line 1
    invoke-super {p0, p1}, Landroid/view/View;->onDraw(Landroid/graphics/Canvas;)V

    .line 2
    iget-boolean v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->j:Z

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->b:Landroid/graphics/Matrix;

    if-eqz v0, :cond_0

    .line 3
    iget-object v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->h:Landroid/graphics/Rect;

    iget-object v1, p0, Lcom/estrongs/android/ui/view/ShimmerView;->c:Landroid/graphics/Paint;

    invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    :cond_0
    return-void
.end method

.method protected onMeasure(II)V
    .locals 0

    .line 1
    invoke-super {p0, p1, p2}, Landroid/view/View;->onMeasure(II)V

    return-void
.end method

.method protected onSizeChanged(IIII)V
    .locals 8

    .line 1
    invoke-super {p0, p1, p2, p3, p4}, Landroid/view/View;->onSizeChanged(IIII)V

    .line 2
    iget p3, p0, Lcom/estrongs/android/ui/view/ShimmerView;->d:I

    if-nez p3, :cond_0

    .line 3
    invoke-virtual {p0}, Landroid/view/View;->getWidth()I

    move-result p3

    iput p3, p0, Lcom/estrongs/android/ui/view/ShimmerView;->d:I

    .line 4
    invoke-virtual {p0}, Landroid/view/View;->getHeight()I

    move-result p3

    iput p3, p0, Lcom/estrongs/android/ui/view/ShimmerView;->e:I

    .line 5
    iget p3, p0, Lcom/estrongs/android/ui/view/ShimmerView;->d:I

    if-lez p3, :cond_0

    .line 6
    new-instance p3, Landroid/graphics/LinearGradient;

    const/4 v1, 0x0

    iget p4, p0, Lcom/estrongs/android/ui/view/ShimmerView;->e:I

    int-to-float v2, p4

    iget p4, p0, Lcom/estrongs/android/ui/view/ShimmerView;->d:I

    div-int/lit8 p4, p4, 0x6

    int-to-float v3, p4

    const/4 v4, 0x0

    const/4 p4, 0x4

    new-array v5, p4, [I

    fill-array-data v5, :array_0

    new-array v6, p4, [F

    fill-array-data v6, :array_1

    sget-object v7, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;

    move-object v0, p3

    invoke-direct/range {v0 .. v7}, Landroid/graphics/LinearGradient;-><init>(FFFF[I[FLandroid/graphics/Shader$TileMode;)V

    iput-object p3, p0, Lcom/estrongs/android/ui/view/ShimmerView;->a:Landroid/graphics/Shader;

    .line 7
    iget-object p4, p0, Lcom/estrongs/android/ui/view/ShimmerView;->c:Landroid/graphics/Paint;

    invoke-virtual {p4, p3}, Landroid/graphics/Paint;->setShader(Landroid/graphics/Shader;)Landroid/graphics/Shader;

    .line 8
    iget-object p3, p0, Lcom/estrongs/android/ui/view/ShimmerView;->c:Landroid/graphics/Paint;

    new-instance p4, Landroid/graphics/PorterDuffXfermode;

    sget-object v0, Landroid/graphics/PorterDuff$Mode;->LIGHTEN:Landroid/graphics/PorterDuff$Mode;

    invoke-direct {p4, v0}, Landroid/graphics/PorterDuffXfermode;-><init>(Landroid/graphics/PorterDuff$Mode;)V

    invoke-virtual {p3, p4}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;

    .line 9
    new-instance p3, Landroid/graphics/Matrix;

    invoke-direct {p3}, Landroid/graphics/Matrix;-><init>()V

    iput-object p3, p0, Lcom/estrongs/android/ui/view/ShimmerView;->b:Landroid/graphics/Matrix;

    .line 10
    iget p4, p0, Lcom/estrongs/android/ui/view/ShimmerView;->d:I

    int-to-float p4, p4

    iget v0, p0, Lcom/estrongs/android/ui/view/ShimmerView;->e:I

    int-to-float v0, v0

    invoke-virtual {p3, p4, v0}, Landroid/graphics/Matrix;->setTranslate(FF)V

    .line 11
    iget-object p3, p0, Lcom/estrongs/android/ui/view/ShimmerView;->a:Landroid/graphics/Shader;

    iget-object p4, p0, Lcom/estrongs/android/ui/view/ShimmerView;->b:Landroid/graphics/Matrix;

    invoke-virtual {p3, p4}, Landroid/graphics/Shader;->setLocalMatrix(Landroid/graphics/Matrix;)V

    .line 12
    iget-object p3, p0, Lcom/estrongs/android/ui/view/ShimmerView;->h:Landroid/graphics/Rect;

    const/4 p4, 0x0

    invoke-virtual {p3, p4, p4, p1, p2}, Landroid/graphics/Rect;->set(IIII)V

    :cond_0
    return-void

    nop

    :array_0
    .array-data 4
        0xffffff
        0x59ffffff
        0x59ffffff
        0xffffff
    .end array-data

    :array_1
    .array-data 4
        0x0
        0x3ecccccd    # 0.4f
        0x3f000000    # 0.5f
        0x3f800000    # 1.0f
    .end array-data
.end method
